local lazypath = vim.fn.stdpath "data" .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
    vim.fn.system {
        "git",
        "clone",
        "--filter=blob:none",
        "https://github.com/folke/lazy.nvim.git",
        "--branch=stable",
        lazypath,
    }
end

vim.opt.rtp:prepend(vim.env.LAZY or lazypath)

require("lazy").setup {
    spec = {
        { import = "user" },
    },
    ui = {
        border = "rounded",
    },
    defaults = {
        lazy = true,
    },
    checker = {
        enabled = true, -- check for plugin updates periodically
        notify = false, -- notify on update
    }, -- automatically check for plugin updates
    performance = {
        rtp = {
            -- disable some rtp plugins
            disabled_plugins = {
                "gzip",
                "matchit",
                "matchparen",
                "netrwPlugin",
                "tarPlugin",
                "tohtml",
                "tutor",
                "zipPlugin",
            },
        },
    },
    install = {
        auto_clean = true,
        missing = true,
        colorscheme = { "catppuccin" },
    },
    change_detection = {
        enabled = true, -- 启用配置文件变化检测
        notify = false, -- 检测到变化时给出通知
    },
}

vim.keymap.set("n", "<leader>xl", "<cmd>Lazy<cr>", { desc = "lazy.nvim" })

